TestCase(
	'Login page test',{

	setUp: function (){
		webapp.initEnvironment();
		webapp.login.init();
	},

	tearDown: function(){
		
	},

	stdTextFieldTest: function(fieldData, type){
		var elementRefStr = 'Text field "' + fieldData.NAME + '" ';

		var els = Ext.query('*[name='+fieldData.NAME+']');
		assertEquals(elementRefStr + 'must be only one', 1, els.length);
		var el = els[0];

		// check field attributes
		assertNotNull(elementRefStr + 'must not be null', el);
		assertEquals (elementRefStr + 'must have a proper type', type, el.type);

		// check field label
		var label = Ext.query('label[for='+el.id+']')[0];
		//assertEquals (elementRefStr + 'must have a proper label', fieldData.LABEL+':', label.innerText);
	},

	testFormInitialization: function(){
		var testData = [
			[webapp.login.IDS.FIELD_LOGIN, 'text'],
			[webapp.login.IDS.FIELD_PASSWORD, 'text'],
			[webapp.login.IDS.FIELD_REMEMBER_ME, 'checkbox']
		];
		for (var ix = 0; ix < testData.length; ix++){
			var data = testData[ix];
			this.stdTextFieldTest(data[0], data[1]);
		}
	}
});